import { toStringTypeCheck } from '../../../Func/uniFunc/Func';
import { win_static_micro_tasks_mana_prop_namespace } from '../DataDefine/sourceData';

const win_static_micro_tasks_manaTag = 'win_static_micro_tasks_mana';

class win_static_micro_tasks_mana {
  get [Symbol.toStringTag]() {
    return win_static_micro_tasks_manaTag;
  }

  constructor() {}

  [win_static_micro_tasks_mana_prop_namespace] = [];

  /**
   * 移除 对应名称 的 监听事件管理 核检
   * @param {string | string[]} spacename
   */
  destroy(spacename) {
    if (toStringTypeCheck(spacename, 'string')) {
      spacename = [spacename];
    }

    for (let cur_spacename of spacename) {
      if (
        this[win_static_micro_tasks_mana_prop_namespace].includes(cur_spacename)
      ) {
        this[cur_spacename].destroy();
      }
    }
  }
}

export { win_static_micro_tasks_mana };
